﻿import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { AppCommonModule } from "@app/shared/common/app-common.module";
import { UtilsModule } from "@shared/utils/utils.module";
import { FileUploadModule } from "ng2-file-upload";
import {
    ModalModule,
    PopoverModule,
    TabsModule,
    TooltipModule,
    BsDropdownModule,
} from "ngx-bootstrap";
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService,
} from "ngx-bootstrap/datepicker";
import {
    AutoCompleteModule,
    EditorModule,
    FileUploadModule as PrimeNgFileUploadModule,
    InputMaskModule,
    PaginatorModule,
    DialogModule,
    CheckboxModule,
    InputSwitchModule,
} from "primeng/primeng";
import { TableModule } from "primeng/table";
import { TreeModule } from "primeng/tree";
import { DragDropModule } from "primeng/dragdrop";
import { TreeDragDropService } from "primeng/api";
import { ContextMenuModule } from "primeng/contextmenu";
import { TaskRoutingModule } from "./task-routing.module";

import { NgxChartsModule } from "@swimlane/ngx-charts";
import { CountoModule } from "angular2-counto";
import { TextMaskModule } from "angular2-text-mask";
import { ImageCropperModule } from "ngx-image-cropper";
import { NgxBootstrapDatePickerConfigService } from "assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service";
import { ImpersonationService } from "@app/admin/users/impersonation.service";
import { MainComponent } from "./main/main.component";
import { CreateOrEditOrderModalComponent } from "./main/create-or-edit-order-modal.component";

import { QRCodeModule } from "angular2-qrcode";
import { NgQrScannerModule } from "angular2-qrscanner";

@NgModule({
    imports: [
        FormsModule,
        ReactiveFormsModule,
        CommonModule,
        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot(),
        TaskRoutingModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        CheckboxModule,
        InputSwitchModule,
        TreeModule,
        DragDropModule,
        DialogModule,
        ContextMenuModule,
        PaginatorModule,
        PrimeNgFileUploadModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        QRCodeModule,
        NgQrScannerModule,
    ],
    declarations: [MainComponent, CreateOrEditOrderModalComponent],
    exports: [],
    providers: [
        ImpersonationService,
        TreeDragDropService,
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig,
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory:
                NgxBootstrapDatePickerConfigService.getDaterangepickerConfig,
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale,
        },
    ],
})
export class TaskModule {}
